#ifndef _TYPE_TRAIT_HPP_20120411
#define _TYPE_TRAIT_HPP_20120411

#include <string>

namespace tools
{
	template <typename _T>
	struct TypeTrait
	{
		enum { base_type = false };
	};

	template <int v>
		struct Int2Type
		{
			enum { value = v };
		};

	template <>
		struct TypeTrait<char>
		{
			enum { base_type = true };
		};
	
	template <>
		struct TypeTrait<unsigned char>
		{
			enum { base_type = true };
		};
	
	template <>
		struct TypeTrait<int16_t>
		{
			enum { base_type = true };
		};

	template <>
		struct TypeTrait<uint16_t>
		{
			enum { base_type = true };
		};

	template <>
		struct TypeTrait<int32_t>
		{
			enum { base_type = true };
		};

	template <>
		struct TypeTrait<uint32_t>
		{
			enum { base_type = true };
		};

	template <>
		struct TypeTrait<int64_t>
		{
			enum { base_type = true };
		};

	template <>
		struct TypeTrait<uint64_t>
		{
			enum { base_type = true };
		};

	template <>
		struct TypeTrait<std::string>
		{
			enum { base_type = true };
		};
};

#endif

